<?php //pack11class

class AdminProperty_text extends Module {

    public $label="Undefined";
    public $panel="";
    public $propID=0;
    public $select_id=0;
    public $count=255;

    public function setup() {
        if(!$this->param) return false;
        $property=$this->param;
        $this->label=str_replace("!","",$property->label);
        $this->propID=$property->id;

        $select=new SelectInput;
        $values=ValuesManager::getValuesByProperty($property);

        $option=new SelectOption;
        $option->label=LabelManager::getLabel("not_used_label");
        $option->value=0;
        $option->selected=SelectOption::SELECTED;
        $select->addChild($option);

        foreach($values as $value) {
            $option=new SelectOption;
            $option->label=ValuesManager::cropText($value->label);
            $option->value=$value->id;
            $option->selected=($property->value==$option->value)? SelectOption::SELECTED:"";
            $select->addChild($option);
        }


        $select->property_name=$property->system;
        $select->setID("AdminObject_".$property->system);
        //$select->events=str_replace('\"', '"', "onChange=\"ObjectCard.setCurrency(this);\"");
        $select->class="select";
        $select->setClass("AP_select");
        $select->lamp_class="hidden";
        $this->select_id="AdminObject_".$property->system;
        $this->addChild($select);
    }

}
?>
